#include <stdio.h>

int main()
{
   int x ,i=0,count=0,d;
   int power =1;
   scanf("%d",&x);
   int m = x;
   int n = x;
   int h = x;
   while(m!=0)
   {
   	 m /= 10;
   	 count++;
   }
   printf("%d\n",count);
   
  for(i =1;i <count;i++)
  {
  	power *=10;
  }
	
	do{
     	printf("%d ",h/power);
		h %=power;
		power /= 10; 
	}while(h != 0);
	
	printf("\n");
   
   while(n)
   {
   	i= n%10;
     printf("%d",i);
	  n/=10; 
   }
	return 0;
}

